/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entitys;

import java.awt.Image;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
@Entity

public class Pet implements Serializable{
    
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private long idPet;
    @Column(length = 15)
    private String name;
    @Column(length = 15)
    private String species;
    @Column(length = 15)
    private int age;
    @Column(length = 15)
    private float weight;
    private Image picture;

    @ManyToOne(cascade= CascadeType.PERSIST)
    private Owner owner;

    @OneToOne(mappedBy = "Pet")
    private MedicalRecord medicalRecord;
       

    public Pet(){
        super();
        }
    public String getname(){
        return name;     
    }
    public void setname(String name){
        this.name = name;
    }
    public String getspecies(){
        return species;
    }
    public void setspecies(String species){
        this.species = species;
    }
    public int getage(){
        return age;
    }
    public void setage(int age){
        this.age = age;
    }
    public float getweight(){
        return weight;     
    }
    public void setweight(float weight){
        this.weight = weight;
    }
    public Image getpicture(){
        return picture;     
    }
    public void setpicture(Image picture){
        this.picture = picture;
    }

    public Long getIdPet() {
        return idPet;
    }

    public void setIdPet(Long idPet) {
        this.idPet = idPet;
    }
}
